﻿'========================================================================
'功能:廠區資料庫存取物件
'作者:andy
'日期: 2011/3/1
'========================================================================

Imports Microsoft.VisualBasic
Imports System
Imports System.Collections.Generic
Imports System.Data.SqlClient
Imports System.Text
Imports System.Data


Namespace Telecom.DAO
    Public Class SiteDAO
        Inherits OAMS.DAO.BaseDAO

        Dim _dbName As String
        Public Sub New(ByVal dbName As String)
            _dbName = dbName
        End Sub

        ''' <summary>
        ''' 取得廠區設定基本資料
        ''' </summary>
        ''' <returns>取得廠區設定基本資料</returns>
        ''' <remarks>取得廠區設定基本資料</remarks>

        Public Function GetAllSite() As DataTable

            Dim sb As New StringBuilder()

            sb.AppendLine(" select * from TEL_SITE_C ")

            Return SqlHelper.ExecuteDataset(MyConn(_dbName), CommandType.Text, sb.ToString()).Tables(0)
        End Function

        Public Function GetAllSite1() As DataTable

            Dim sb As New StringBuilder()
            sb.AppendLine(" select '' as  site_code,'' as  site_name  union  ")
            sb.AppendLine(" select site_code,site_name from TEL_SITE_C ")

            Return SqlHelper.ExecuteDataset(MyConn(_dbName), CommandType.Text, sb.ToString()).Tables(0)
        End Function


    End Class


End Namespace


